package com.gxa.ibear.controller;


import com.gxa.ibear.common.R;
import com.gxa.ibear.entity.pojo.User;
import com.gxa.ibear.exception.BizException;
import com.gxa.ibear.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gxa
 * @since 2023-11-21
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/getById")
    public R getById(Integer id) throws BizException {

        User byId = userService.getById(id);
        return R.success(byId);
    }

}

